#include<iostream>
#include<memory>
#include"client.hpp"
#include"err.hpp"
using namespace std;
using namespace nt_client;

void Usage(const char* program)
{
     cout << "Usage:" << endl;
  cout << "\t" << program << " ServerIP ServerPort" << endl;
}

int main(int argc, char* argv[])
{
    if(argc  != 3)
    {
        // 错误的启动方式，提示错误信息
        Usage(argv[0]);
        return USAGE_ERR;
    }

    std::string ip = argv[1];
    uint16_t port = stoi(argv[2]);

    unique_ptr<UdpClient> usvr(new UdpClient(ip,port));

    // 初始化客户端
    usvr->InitClient();

    // 启动客户端
    usvr->StartClient();

    return 0;


}